//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_spi(SotoInternal) import SotoCore

extension Chime {
    // MARK: Enums

    public enum AccountStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case active = "Active"
        case suspended = "Suspended"
        public var description: String { return self.rawValue }
    }

    public enum AccountType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case enterpriseDirectory = "EnterpriseDirectory"
        case enterpriseLWA = "EnterpriseLWA"
        case enterpriseOIDC = "EnterpriseOIDC"
        case team = "Team"
        public var description: String { return self.rawValue }
    }

    public enum BotType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case chatBot = "ChatBot"
        public var description: String { return self.rawValue }
    }

    public enum CallingNameStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case unassigned = "Unassigned"
        case updateFailed = "UpdateFailed"
        case updateInProgress = "UpdateInProgress"
        case updateSucceeded = "UpdateSucceeded"
        public var description: String { return self.rawValue }
    }

    public enum EmailStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case failed = "Failed"
        case notSent = "NotSent"
        case sent = "Sent"
        public var description: String { return self.rawValue }
    }

    public enum ErrorCode: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case accessDenied = "AccessDenied"
        case badRequest = "BadRequest"
        case conflict = "Conflict"
        case forbidden = "Forbidden"
        case notFound = "NotFound"
        case phoneNumberAssociationsExist = "PhoneNumberAssociationsExist"
        case preconditionFailed = "PreconditionFailed"
        case resourceLimitExceeded = "ResourceLimitExceeded"
        case serviceFailure = "ServiceFailure"
        case serviceUnavailable = "ServiceUnavailable"
        case throttled = "Throttled"
        case throttling = "Throttling"
        case unauthorized = "Unauthorized"
        case unprocessable = "Unprocessable"
        case voiceConnectorGroupAssociationsExist = "VoiceConnectorGroupAssociationsExist"
        public var description: String { return self.rawValue }
    }

    public enum InviteStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case accepted = "Accepted"
        case failed = "Failed"
        case pending = "Pending"
        public var description: String { return self.rawValue }
    }

    public enum License: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case basic = "Basic"
        case plus = "Plus"
        case pro = "Pro"
        case proTrial = "ProTrial"
        public var description: String { return self.rawValue }
    }

    public enum MemberType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case bot = "Bot"
        case user = "User"
        case webhook = "Webhook"
        public var description: String { return self.rawValue }
    }

    public enum OrderedPhoneNumberStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case acquired = "Acquired"
        case failed = "Failed"
        case processing = "Processing"
        public var description: String { return self.rawValue }
    }

    public enum PhoneNumberAssociationName: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case accountId = "AccountId"
        case sipRuleId = "SipRuleId"
        case userId = "UserId"
        case voiceConnectorGroupId = "VoiceConnectorGroupId"
        case voiceConnectorId = "VoiceConnectorId"
        public var description: String { return self.rawValue }
    }

    public enum PhoneNumberOrderStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case failed = "Failed"
        case partial = "Partial"
        case processing = "Processing"
        case successful = "Successful"
        public var description: String { return self.rawValue }
    }

    public enum PhoneNumberProductType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case businessCalling = "BusinessCalling"
        case sipMediaApplicationDialIn = "SipMediaApplicationDialIn"
        case voiceConnector = "VoiceConnector"
        public var description: String { return self.rawValue }
    }

    public enum PhoneNumberStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case acquireFailed = "AcquireFailed"
        case acquireInProgress = "AcquireInProgress"
        case assigned = "Assigned"
        case deleteFailed = "DeleteFailed"
        case deleteInProgress = "DeleteInProgress"
        case releaseFailed = "ReleaseFailed"
        case releaseInProgress = "ReleaseInProgress"
        case unassigned = "Unassigned"
        public var description: String { return self.rawValue }
    }

    public enum PhoneNumberType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case local = "Local"
        case tollFree = "TollFree"
        public var description: String { return self.rawValue }
    }

    public enum RegistrationStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case registered = "Registered"
        case suspended = "Suspended"
        case unregistered = "Unregistered"
        public var description: String { return self.rawValue }
    }

    public enum RoomMembershipRole: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case administrator = "Administrator"
        case member = "Member"
        public var description: String { return self.rawValue }
    }

    public enum UserType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case privateUser = "PrivateUser"
        case sharedDevice = "SharedDevice"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct AccessDeniedException: AWSErrorShape {
        public let code: ErrorCode?
        public let message: String?

        @inlinable
        public init(code: ErrorCode? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct Account: AWSDecodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The status of the account.
        public let accountStatus: AccountStatus?
        /// The Amazon Chime account type. For more information about different account types, see  Managing Your Amazon Chime Accounts in the Amazon Chime Administration Guide.
        public let accountType: AccountType?
        /// The AWS account ID.
        public let awsAccountId: String
        /// The Amazon Chime account creation timestamp, in ISO 8601 format.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var createdTimestamp: Date?
        /// The default license for the Amazon Chime account.
        public let defaultLicense: License?
        /// The Amazon Chime account name.
        public let name: String
        /// The sign-in delegate groups associated with the account.
        public let signinDelegateGroups: [SigninDelegateGroup]?
        /// Supported licenses for the Amazon Chime account.
        public let supportedLicenses: [License]?

        @inlinable
        public init(accountId: String, accountStatus: AccountStatus? = nil, accountType: AccountType? = nil, awsAccountId: String, createdTimestamp: Date? = nil, defaultLicense: License? = nil, name: String, signinDelegateGroups: [SigninDelegateGroup]? = nil, supportedLicenses: [License]? = nil) {
            self.accountId = accountId
            self.accountStatus = accountStatus
            self.accountType = accountType
            self.awsAccountId = awsAccountId
            self.createdTimestamp = createdTimestamp
            self.defaultLicense = defaultLicense
            self.name = name
            self.signinDelegateGroups = signinDelegateGroups
            self.supportedLicenses = supportedLicenses
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case accountStatus = "AccountStatus"
            case accountType = "AccountType"
            case awsAccountId = "AwsAccountId"
            case createdTimestamp = "CreatedTimestamp"
            case defaultLicense = "DefaultLicense"
            case name = "Name"
            case signinDelegateGroups = "SigninDelegateGroups"
            case supportedLicenses = "SupportedLicenses"
        }
    }

    public struct AccountSettings: AWSEncodableShape & AWSDecodableShape {
        /// Setting that stops or starts remote control of shared screens during meetings.
        public let disableRemoteControl: Bool?
        /// Setting that allows meeting participants to choose the Call me at a phone number option. For more information, see  Join a Meeting without the Amazon Chime App.
        public let enableDialOut: Bool?

        @inlinable
        public init(disableRemoteControl: Bool? = nil, enableDialOut: Bool? = nil) {
            self.disableRemoteControl = disableRemoteControl
            self.enableDialOut = enableDialOut
        }

        private enum CodingKeys: String, CodingKey {
            case disableRemoteControl = "DisableRemoteControl"
            case enableDialOut = "EnableDialOut"
        }
    }

    public struct AlexaForBusinessMetadata: AWSEncodableShape & AWSDecodableShape {
        /// The ARN of the room resource.
        public let alexaForBusinessRoomArn: String?
        /// Starts or stops Alexa for Business.
        public let isAlexaForBusinessEnabled: Bool?

        @inlinable
        public init(alexaForBusinessRoomArn: String? = nil, isAlexaForBusinessEnabled: Bool? = nil) {
            self.alexaForBusinessRoomArn = alexaForBusinessRoomArn
            self.isAlexaForBusinessEnabled = isAlexaForBusinessEnabled
        }

        private enum CodingKeys: String, CodingKey {
            case alexaForBusinessRoomArn = "AlexaForBusinessRoomArn"
            case isAlexaForBusinessEnabled = "IsAlexaForBusinessEnabled"
        }
    }

    public struct AssociatePhoneNumberWithUserRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The phone number, in E.164 format.
        public let e164PhoneNumber: String
        /// The user ID.
        public let userId: String

        @inlinable
        public init(accountId: String, e164PhoneNumber: String, userId: String) {
            self.accountId = accountId
            self.e164PhoneNumber = e164PhoneNumber
            self.userId = userId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            try container.encode(self.e164PhoneNumber, forKey: .e164PhoneNumber)
            request.encodePath(self.userId, key: "UserId")
        }

        public func validate(name: String) throws {
            try self.validate(self.e164PhoneNumber, name: "e164PhoneNumber", parent: name, pattern: "^\\+?[1-9]\\d{1,14}$")
        }

        private enum CodingKeys: String, CodingKey {
            case e164PhoneNumber = "E164PhoneNumber"
        }
    }

    public struct AssociatePhoneNumberWithUserResponse: AWSDecodableShape {
        public init() {}
    }

    public struct AssociateSigninDelegateGroupsWithAccountRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The sign-in delegate groups.
        public let signinDelegateGroups: [SigninDelegateGroup]

        @inlinable
        public init(accountId: String, signinDelegateGroups: [SigninDelegateGroup]) {
            self.accountId = accountId
            self.signinDelegateGroups = signinDelegateGroups
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            try container.encode(self.signinDelegateGroups, forKey: .signinDelegateGroups)
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.signinDelegateGroups.forEach {
                try $0.validate(name: "\(name).signinDelegateGroups[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case signinDelegateGroups = "SigninDelegateGroups"
        }
    }

    public struct AssociateSigninDelegateGroupsWithAccountResponse: AWSDecodableShape {
        public init() {}
    }

    public struct BadRequestException: AWSErrorShape {
        public let code: ErrorCode?
        public let message: String?

        @inlinable
        public init(code: ErrorCode? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct BatchCreateRoomMembershipRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The list of membership items.
        public let membershipItemList: [MembershipItem]
        /// The room ID.
        public let roomId: String

        @inlinable
        public init(accountId: String, membershipItemList: [MembershipItem], roomId: String) {
            self.accountId = accountId
            self.membershipItemList = membershipItemList
            self.roomId = roomId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            try container.encode(self.membershipItemList, forKey: .membershipItemList)
            request.encodePath(self.roomId, key: "RoomId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.membershipItemList.forEach {
                try $0.validate(name: "\(name).membershipItemList[]")
            }
            try self.validate(self.membershipItemList, name: "membershipItemList", parent: name, max: 50)
            try self.validate(self.roomId, name: "roomId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case membershipItemList = "MembershipItemList"
        }
    }

    public struct BatchCreateRoomMembershipResponse: AWSDecodableShape {
        /// If the action fails for one or more of the member IDs in the request, a list of the member IDs is returned, along with error codes and error messages.
        public let errors: [MemberError]?

        @inlinable
        public init(errors: [MemberError]? = nil) {
            self.errors = errors
        }

        private enum CodingKeys: String, CodingKey {
            case errors = "Errors"
        }
    }

    public struct BatchDeletePhoneNumberRequest: AWSEncodableShape {
        /// List of phone number IDs.
        public let phoneNumberIds: [String]

        @inlinable
        public init(phoneNumberIds: [String]) {
            self.phoneNumberIds = phoneNumberIds
        }

        public func validate(name: String) throws {
            try self.validate(self.phoneNumberIds, name: "phoneNumberIds", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case phoneNumberIds = "PhoneNumberIds"
        }
    }

    public struct BatchDeletePhoneNumberResponse: AWSDecodableShape {
        /// If the action fails for one or more of the phone numbers in the request, a list of the phone numbers is returned, along with error codes and error messages.
        public let phoneNumberErrors: [PhoneNumberError]?

        @inlinable
        public init(phoneNumberErrors: [PhoneNumberError]? = nil) {
            self.phoneNumberErrors = phoneNumberErrors
        }

        private enum CodingKeys: String, CodingKey {
            case phoneNumberErrors = "PhoneNumberErrors"
        }
    }

    public struct BatchSuspendUserRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The request containing the user IDs to suspend.
        public let userIdList: [String]

        @inlinable
        public init(accountId: String, userIdList: [String]) {
            self.accountId = accountId
            self.userIdList = userIdList
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            try container.encode(self.userIdList, forKey: .userIdList)
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.userIdList.forEach {
                try validate($0, name: "userIdList[]", parent: name, pattern: "\\S")
            }
            try self.validate(self.userIdList, name: "userIdList", parent: name, max: 50)
        }

        private enum CodingKeys: String, CodingKey {
            case userIdList = "UserIdList"
        }
    }

    public struct BatchSuspendUserResponse: AWSDecodableShape {
        /// If the BatchSuspendUser action fails for one or more of the user IDs in the request, a list of the user IDs is returned, along with error codes and error messages.
        public let userErrors: [UserError]?

        @inlinable
        public init(userErrors: [UserError]? = nil) {
            self.userErrors = userErrors
        }

        private enum CodingKeys: String, CodingKey {
            case userErrors = "UserErrors"
        }
    }

    public struct BatchUnsuspendUserRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The request containing the user IDs to unsuspend.
        public let userIdList: [String]

        @inlinable
        public init(accountId: String, userIdList: [String]) {
            self.accountId = accountId
            self.userIdList = userIdList
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            try container.encode(self.userIdList, forKey: .userIdList)
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.userIdList.forEach {
                try validate($0, name: "userIdList[]", parent: name, pattern: "\\S")
            }
            try self.validate(self.userIdList, name: "userIdList", parent: name, max: 50)
        }

        private enum CodingKeys: String, CodingKey {
            case userIdList = "UserIdList"
        }
    }

    public struct BatchUnsuspendUserResponse: AWSDecodableShape {
        /// If the BatchUnsuspendUser action fails for one or more of the user IDs in the request, a list of the user IDs is returned, along with error codes and error messages.
        public let userErrors: [UserError]?

        @inlinable
        public init(userErrors: [UserError]? = nil) {
            self.userErrors = userErrors
        }

        private enum CodingKeys: String, CodingKey {
            case userErrors = "UserErrors"
        }
    }

    public struct BatchUpdatePhoneNumberRequest: AWSEncodableShape {
        /// The request containing the phone number IDs and product types or calling names to update.
        public let updatePhoneNumberRequestItems: [UpdatePhoneNumberRequestItem]

        @inlinable
        public init(updatePhoneNumberRequestItems: [UpdatePhoneNumberRequestItem]) {
            self.updatePhoneNumberRequestItems = updatePhoneNumberRequestItems
        }

        public func validate(name: String) throws {
            try self.updatePhoneNumberRequestItems.forEach {
                try $0.validate(name: "\(name).updatePhoneNumberRequestItems[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case updatePhoneNumberRequestItems = "UpdatePhoneNumberRequestItems"
        }
    }

    public struct BatchUpdatePhoneNumberResponse: AWSDecodableShape {
        /// If the action fails for one or more of the phone numbers in the request, a list of the phone numbers is returned, along with error codes and error messages.
        public let phoneNumberErrors: [PhoneNumberError]?

        @inlinable
        public init(phoneNumberErrors: [PhoneNumberError]? = nil) {
            self.phoneNumberErrors = phoneNumberErrors
        }

        private enum CodingKeys: String, CodingKey {
            case phoneNumberErrors = "PhoneNumberErrors"
        }
    }

    public struct BatchUpdateUserRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The request containing the user IDs and details to update.
        public let updateUserRequestItems: [UpdateUserRequestItem]

        @inlinable
        public init(accountId: String, updateUserRequestItems: [UpdateUserRequestItem]) {
            self.accountId = accountId
            self.updateUserRequestItems = updateUserRequestItems
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            try container.encode(self.updateUserRequestItems, forKey: .updateUserRequestItems)
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.updateUserRequestItems.forEach {
                try $0.validate(name: "\(name).updateUserRequestItems[]")
            }
            try self.validate(self.updateUserRequestItems, name: "updateUserRequestItems", parent: name, max: 20)
        }

        private enum CodingKeys: String, CodingKey {
            case updateUserRequestItems = "UpdateUserRequestItems"
        }
    }

    public struct BatchUpdateUserResponse: AWSDecodableShape {
        /// If the BatchUpdateUser action fails for one or more of the user IDs in the request, a list of the user IDs is returned, along with error codes and error messages.
        public let userErrors: [UserError]?

        @inlinable
        public init(userErrors: [UserError]? = nil) {
            self.userErrors = userErrors
        }

        private enum CodingKeys: String, CodingKey {
            case userErrors = "UserErrors"
        }
    }

    public struct Bot: AWSDecodableShape {
        /// The bot email address.
        public let botEmail: String?
        /// The bot ID.
        public let botId: String?
        /// The bot type.
        public let botType: BotType?
        /// The bot creation timestamp, in ISO 8601 format.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var createdTimestamp: Date?
        /// When true, the bot is stopped from running in your account.
        public let disabled: Bool?
        /// The bot display name.
        public let displayName: String?
        /// The security token used to authenticate Amazon Chime with the outgoing event endpoint.
        public let securityToken: String?
        /// The updated bot timestamp, in ISO 8601 format.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var updatedTimestamp: Date?
        /// The unique ID for the bot user.
        public let userId: String?

        @inlinable
        public init(botEmail: String? = nil, botId: String? = nil, botType: BotType? = nil, createdTimestamp: Date? = nil, disabled: Bool? = nil, displayName: String? = nil, securityToken: String? = nil, updatedTimestamp: Date? = nil, userId: String? = nil) {
            self.botEmail = botEmail
            self.botId = botId
            self.botType = botType
            self.createdTimestamp = createdTimestamp
            self.disabled = disabled
            self.displayName = displayName
            self.securityToken = securityToken
            self.updatedTimestamp = updatedTimestamp
            self.userId = userId
        }

        private enum CodingKeys: String, CodingKey {
            case botEmail = "BotEmail"
            case botId = "BotId"
            case botType = "BotType"
            case createdTimestamp = "CreatedTimestamp"
            case disabled = "Disabled"
            case displayName = "DisplayName"
            case securityToken = "SecurityToken"
            case updatedTimestamp = "UpdatedTimestamp"
            case userId = "UserId"
        }
    }

    public struct BusinessCallingSettings: AWSEncodableShape & AWSDecodableShape {
        /// The Amazon S3 bucket designated for call detail record storage.
        public let cdrBucket: String?

        @inlinable
        public init(cdrBucket: String? = nil) {
            self.cdrBucket = cdrBucket
        }

        private enum CodingKeys: String, CodingKey {
            case cdrBucket = "CdrBucket"
        }
    }

    public struct ConflictException: AWSErrorShape {
        public let code: ErrorCode?
        public let message: String?

        @inlinable
        public init(code: ErrorCode? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct ConversationRetentionSettings: AWSEncodableShape & AWSDecodableShape {
        /// The number of days for which to retain conversation messages.
        public let retentionDays: Int?

        @inlinable
        public init(retentionDays: Int? = nil) {
            self.retentionDays = retentionDays
        }

        public func validate(name: String) throws {
            try self.validate(self.retentionDays, name: "retentionDays", parent: name, max: 5475)
            try self.validate(self.retentionDays, name: "retentionDays", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case retentionDays = "RetentionDays"
        }
    }

    public struct CreateAccountRequest: AWSEncodableShape {
        /// The name of the Amazon Chime account.
        public let name: String

        @inlinable
        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 100)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct CreateAccountResponse: AWSDecodableShape {
        /// The Amazon Chime account details.
        public let account: Account?

        @inlinable
        public init(account: Account? = nil) {
            self.account = account
        }

        private enum CodingKeys: String, CodingKey {
            case account = "Account"
        }
    }

    public struct CreateBotRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The bot display name.
        public let displayName: String
        /// The domain of the Amazon Chime Enterprise account.
        public let domain: String?

        @inlinable
        public init(accountId: String, displayName: String, domain: String? = nil) {
            self.accountId = accountId
            self.displayName = displayName
            self.domain = domain
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            try container.encode(self.displayName, forKey: .displayName)
            try container.encodeIfPresent(self.domain, forKey: .domain)
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.domain, name: "domain", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case displayName = "DisplayName"
            case domain = "Domain"
        }
    }

    public struct CreateBotResponse: AWSDecodableShape {
        /// The bot details.
        public let bot: Bot?

        @inlinable
        public init(bot: Bot? = nil) {
            self.bot = bot
        }

        private enum CodingKeys: String, CodingKey {
            case bot = "Bot"
        }
    }

    public struct CreateMeetingDialOutRequest: AWSEncodableShape {
        /// Phone number used as the caller ID when the remote party receives a call.
        public let fromPhoneNumber: String
        /// Token used by the Amazon Chime SDK attendee. Call the CreateAttendee action to get a join token.
        public let joinToken: String
        /// The Amazon Chime SDK meeting ID.
        public let meetingId: String
        /// Phone number called when inviting someone to a meeting.
        public let toPhoneNumber: String

        @inlinable
        public init(fromPhoneNumber: String, joinToken: String, meetingId: String, toPhoneNumber: String) {
            self.fromPhoneNumber = fromPhoneNumber
            self.joinToken = joinToken
            self.meetingId = meetingId
            self.toPhoneNumber = toPhoneNumber
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            try container.encode(self.fromPhoneNumber, forKey: .fromPhoneNumber)
            try container.encode(self.joinToken, forKey: .joinToken)
            request.encodePath(self.meetingId, key: "MeetingId")
            try container.encode(self.toPhoneNumber, forKey: .toPhoneNumber)
        }

        public func validate(name: String) throws {
            try self.validate(self.fromPhoneNumber, name: "fromPhoneNumber", parent: name, pattern: "^\\+?[1-9]\\d{1,14}$")
            try self.validate(self.joinToken, name: "joinToken", parent: name, max: 2048)
            try self.validate(self.joinToken, name: "joinToken", parent: name, min: 2)
            try self.validate(self.joinToken, name: "joinToken", parent: name, pattern: "^[a-zA-Z0-9+/]+$")
            try self.validate(self.meetingId, name: "meetingId", parent: name, pattern: "^[a-fA-F0-9]{8}(?:-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$")
            try self.validate(self.toPhoneNumber, name: "toPhoneNumber", parent: name, pattern: "^\\+?[1-9]\\d{1,14}$")
        }

        private enum CodingKeys: String, CodingKey {
            case fromPhoneNumber = "FromPhoneNumber"
            case joinToken = "JoinToken"
            case toPhoneNumber = "ToPhoneNumber"
        }
    }

    public struct CreateMeetingDialOutResponse: AWSDecodableShape {
        /// Unique ID that tracks API calls.
        public let transactionId: String?

        @inlinable
        public init(transactionId: String? = nil) {
            self.transactionId = transactionId
        }

        private enum CodingKeys: String, CodingKey {
            case transactionId = "TransactionId"
        }
    }

    public struct CreatePhoneNumberOrderRequest: AWSEncodableShape {
        /// List of phone numbers, in E.164 format.
        public let e164PhoneNumbers: [String]
        /// The phone number product type.
        public let productType: PhoneNumberProductType

        @inlinable
        public init(e164PhoneNumbers: [String], productType: PhoneNumberProductType) {
            self.e164PhoneNumbers = e164PhoneNumbers
            self.productType = productType
        }

        public func validate(name: String) throws {
            try self.e164PhoneNumbers.forEach {
                try validate($0, name: "e164PhoneNumbers[]", parent: name, pattern: "^\\+?[1-9]\\d{1,14}$")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case e164PhoneNumbers = "E164PhoneNumbers"
            case productType = "ProductType"
        }
    }

    public struct CreatePhoneNumberOrderResponse: AWSDecodableShape {
        /// The phone number order details.
        public let phoneNumberOrder: PhoneNumberOrder?

        @inlinable
        public init(phoneNumberOrder: PhoneNumberOrder? = nil) {
            self.phoneNumberOrder = phoneNumberOrder
        }

        private enum CodingKeys: String, CodingKey {
            case phoneNumberOrder = "PhoneNumberOrder"
        }
    }

    public struct CreateRoomMembershipRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The Amazon Chime member ID (user ID or bot ID).
        public let memberId: String
        /// The role of the member.
        public let role: RoomMembershipRole?
        /// The room ID.
        public let roomId: String

        @inlinable
        public init(accountId: String, memberId: String, role: RoomMembershipRole? = nil, roomId: String) {
            self.accountId = accountId
            self.memberId = memberId
            self.role = role
            self.roomId = roomId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            try container.encode(self.memberId, forKey: .memberId)
            try container.encodeIfPresent(self.role, forKey: .role)
            request.encodePath(self.roomId, key: "RoomId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.memberId, name: "memberId", parent: name, pattern: "\\S")
            try self.validate(self.roomId, name: "roomId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case memberId = "MemberId"
            case role = "Role"
        }
    }

    public struct CreateRoomMembershipResponse: AWSDecodableShape {
        /// The room membership details.
        public let roomMembership: RoomMembership?

        @inlinable
        public init(roomMembership: RoomMembership? = nil) {
            self.roomMembership = roomMembership
        }

        private enum CodingKeys: String, CodingKey {
            case roomMembership = "RoomMembership"
        }
    }

    public struct CreateRoomRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The idempotency token for the request.
        public let clientRequestToken: String?
        /// The room name.
        public let name: String

        @inlinable
        public init(accountId: String, clientRequestToken: String? = CreateRoomRequest.idempotencyToken(), name: String) {
            self.accountId = accountId
            self.clientRequestToken = clientRequestToken
            self.name = name
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            try container.encodeIfPresent(self.clientRequestToken, forKey: .clientRequestToken)
            try container.encode(self.name, forKey: .name)
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, max: 64)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, min: 2)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, pattern: "^[-_a-zA-Z0-9]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case clientRequestToken = "ClientRequestToken"
            case name = "Name"
        }
    }

    public struct CreateRoomResponse: AWSDecodableShape {
        /// The room details.
        public let room: Room?

        @inlinable
        public init(room: Room? = nil) {
            self.room = room
        }

        private enum CodingKeys: String, CodingKey {
            case room = "Room"
        }
    }

    public struct CreateUserRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The user's email address.
        public let email: String?
        /// The user name.
        public let username: String?
        /// The user type.
        public let userType: UserType?

        @inlinable
        public init(accountId: String, email: String? = nil, username: String? = nil, userType: UserType? = nil) {
            self.accountId = accountId
            self.email = email
            self.username = username
            self.userType = userType
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            try container.encodeIfPresent(self.email, forKey: .email)
            try container.encodeIfPresent(self.username, forKey: .username)
            try container.encodeIfPresent(self.userType, forKey: .userType)
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.email, name: "email", parent: name, pattern: "^.+@.+\\..+$")
        }

        private enum CodingKeys: String, CodingKey {
            case email = "Email"
            case username = "Username"
            case userType = "UserType"
        }
    }

    public struct CreateUserResponse: AWSDecodableShape {
        /// The user on the Amazon Chime account.
        public let user: User?

        @inlinable
        public init(user: User? = nil) {
            self.user = user
        }

        private enum CodingKeys: String, CodingKey {
            case user = "User"
        }
    }

    public struct DeleteAccountRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String

        @inlinable
        public init(accountId: String) {
            self.accountId = accountId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeleteAccountResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteEventsConfigurationRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The bot ID.
        public let botId: String

        @inlinable
        public init(accountId: String, botId: String) {
            self.accountId = accountId
            self.botId = botId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodePath(self.botId, key: "BotId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.botId, name: "botId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeletePhoneNumberRequest: AWSEncodableShape {
        /// The phone number ID.
        public let phoneNumberId: String

        @inlinable
        public init(phoneNumberId: String) {
            self.phoneNumberId = phoneNumberId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.phoneNumberId, key: "PhoneNumberId")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeleteRoomMembershipRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The member ID (user ID or bot ID).
        public let memberId: String
        /// The room ID.
        public let roomId: String

        @inlinable
        public init(accountId: String, memberId: String, roomId: String) {
            self.accountId = accountId
            self.memberId = memberId
            self.roomId = roomId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodePath(self.memberId, key: "MemberId")
            request.encodePath(self.roomId, key: "RoomId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.memberId, name: "memberId", parent: name, pattern: "\\S")
            try self.validate(self.roomId, name: "roomId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeleteRoomRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The chat room ID.
        public let roomId: String

        @inlinable
        public init(accountId: String, roomId: String) {
            self.accountId = accountId
            self.roomId = roomId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodePath(self.roomId, key: "RoomId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.roomId, name: "roomId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DisassociatePhoneNumberFromUserRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The user ID.
        public let userId: String

        @inlinable
        public init(accountId: String, userId: String) {
            self.accountId = accountId
            self.userId = userId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodePath(self.userId, key: "UserId")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DisassociatePhoneNumberFromUserResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DisassociateSigninDelegateGroupsFromAccountRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The sign-in delegate group names.
        public let groupNames: [String]

        @inlinable
        public init(accountId: String, groupNames: [String]) {
            self.accountId = accountId
            self.groupNames = groupNames
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            try container.encode(self.groupNames, forKey: .groupNames)
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.groupNames, name: "groupNames", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case groupNames = "GroupNames"
        }
    }

    public struct DisassociateSigninDelegateGroupsFromAccountResponse: AWSDecodableShape {
        public init() {}
    }

    public struct EventsConfiguration: AWSDecodableShape {
        /// The bot ID.
        public let botId: String?
        /// Lambda function ARN that allows a bot to receive outgoing events.
        public let lambdaFunctionArn: String?
        /// HTTPS endpoint that allows a bot to receive outgoing events.
        public let outboundEventsHTTPSEndpoint: String?

        @inlinable
        public init(botId: String? = nil, lambdaFunctionArn: String? = nil, outboundEventsHTTPSEndpoint: String? = nil) {
            self.botId = botId
            self.lambdaFunctionArn = lambdaFunctionArn
            self.outboundEventsHTTPSEndpoint = outboundEventsHTTPSEndpoint
        }

        private enum CodingKeys: String, CodingKey {
            case botId = "BotId"
            case lambdaFunctionArn = "LambdaFunctionArn"
            case outboundEventsHTTPSEndpoint = "OutboundEventsHTTPSEndpoint"
        }
    }

    public struct ForbiddenException: AWSErrorShape {
        public let code: ErrorCode?
        public let message: String?

        @inlinable
        public init(code: ErrorCode? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct GetAccountRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String

        @inlinable
        public init(accountId: String) {
            self.accountId = accountId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetAccountResponse: AWSDecodableShape {
        /// The Amazon Chime account details.
        public let account: Account?

        @inlinable
        public init(account: Account? = nil) {
            self.account = account
        }

        private enum CodingKeys: String, CodingKey {
            case account = "Account"
        }
    }

    public struct GetAccountSettingsRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String

        @inlinable
        public init(accountId: String) {
            self.accountId = accountId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetAccountSettingsResponse: AWSDecodableShape {
        /// The Amazon Chime account settings.
        public let accountSettings: AccountSettings?

        @inlinable
        public init(accountSettings: AccountSettings? = nil) {
            self.accountSettings = accountSettings
        }

        private enum CodingKeys: String, CodingKey {
            case accountSettings = "AccountSettings"
        }
    }

    public struct GetBotRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The bot ID.
        public let botId: String

        @inlinable
        public init(accountId: String, botId: String) {
            self.accountId = accountId
            self.botId = botId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodePath(self.botId, key: "BotId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.botId, name: "botId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetBotResponse: AWSDecodableShape {
        /// The chat bot details.
        public let bot: Bot?

        @inlinable
        public init(bot: Bot? = nil) {
            self.bot = bot
        }

        private enum CodingKeys: String, CodingKey {
            case bot = "Bot"
        }
    }

    public struct GetEventsConfigurationRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The bot ID.
        public let botId: String

        @inlinable
        public init(accountId: String, botId: String) {
            self.accountId = accountId
            self.botId = botId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodePath(self.botId, key: "BotId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.botId, name: "botId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetEventsConfigurationResponse: AWSDecodableShape {
        /// The events configuration details.
        public let eventsConfiguration: EventsConfiguration?

        @inlinable
        public init(eventsConfiguration: EventsConfiguration? = nil) {
            self.eventsConfiguration = eventsConfiguration
        }

        private enum CodingKeys: String, CodingKey {
            case eventsConfiguration = "EventsConfiguration"
        }
    }

    public struct GetGlobalSettingsResponse: AWSDecodableShape {
        /// The Amazon Chime Business Calling settings.
        public let businessCalling: BusinessCallingSettings?
        /// The Amazon Chime Voice Connector settings.
        public let voiceConnector: VoiceConnectorSettings?

        @inlinable
        public init(businessCalling: BusinessCallingSettings? = nil, voiceConnector: VoiceConnectorSettings? = nil) {
            self.businessCalling = businessCalling
            self.voiceConnector = voiceConnector
        }

        private enum CodingKeys: String, CodingKey {
            case businessCalling = "BusinessCalling"
            case voiceConnector = "VoiceConnector"
        }
    }

    public struct GetPhoneNumberOrderRequest: AWSEncodableShape {
        /// The ID for the phone number order.
        public let phoneNumberOrderId: String

        @inlinable
        public init(phoneNumberOrderId: String) {
            self.phoneNumberOrderId = phoneNumberOrderId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.phoneNumberOrderId, key: "PhoneNumberOrderId")
        }

        public func validate(name: String) throws {
            try self.validate(self.phoneNumberOrderId, name: "phoneNumberOrderId", parent: name, pattern: "^[a-fA-F0-9]{8}(?:-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetPhoneNumberOrderResponse: AWSDecodableShape {
        /// The phone number order details.
        public let phoneNumberOrder: PhoneNumberOrder?

        @inlinable
        public init(phoneNumberOrder: PhoneNumberOrder? = nil) {
            self.phoneNumberOrder = phoneNumberOrder
        }

        private enum CodingKeys: String, CodingKey {
            case phoneNumberOrder = "PhoneNumberOrder"
        }
    }

    public struct GetPhoneNumberRequest: AWSEncodableShape {
        /// The phone number ID.
        public let phoneNumberId: String

        @inlinable
        public init(phoneNumberId: String) {
            self.phoneNumberId = phoneNumberId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.phoneNumberId, key: "PhoneNumberId")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetPhoneNumberResponse: AWSDecodableShape {
        /// The phone number details.
        public let phoneNumber: PhoneNumber?

        @inlinable
        public init(phoneNumber: PhoneNumber? = nil) {
            self.phoneNumber = phoneNumber
        }

        private enum CodingKeys: String, CodingKey {
            case phoneNumber = "PhoneNumber"
        }
    }

    public struct GetPhoneNumberSettingsResponse: AWSDecodableShape {
        /// The default outbound calling name for the account.
        public let callingName: String?
        /// The updated outbound calling name timestamp, in ISO 8601 format.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var callingNameUpdatedTimestamp: Date?

        @inlinable
        public init(callingName: String? = nil, callingNameUpdatedTimestamp: Date? = nil) {
            self.callingName = callingName
            self.callingNameUpdatedTimestamp = callingNameUpdatedTimestamp
        }

        private enum CodingKeys: String, CodingKey {
            case callingName = "CallingName"
            case callingNameUpdatedTimestamp = "CallingNameUpdatedTimestamp"
        }
    }

    public struct GetRetentionSettingsRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String

        @inlinable
        public init(accountId: String) {
            self.accountId = accountId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetRetentionSettingsResponse: AWSDecodableShape {
        /// The timestamp representing the time at which the specified items are permanently deleted, in ISO 8601 format.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var initiateDeletionTimestamp: Date?
        /// The retention settings.
        public let retentionSettings: RetentionSettings?

        @inlinable
        public init(initiateDeletionTimestamp: Date? = nil, retentionSettings: RetentionSettings? = nil) {
            self.initiateDeletionTimestamp = initiateDeletionTimestamp
            self.retentionSettings = retentionSettings
        }

        private enum CodingKeys: String, CodingKey {
            case initiateDeletionTimestamp = "InitiateDeletionTimestamp"
            case retentionSettings = "RetentionSettings"
        }
    }

    public struct GetRoomRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The room ID.
        public let roomId: String

        @inlinable
        public init(accountId: String, roomId: String) {
            self.accountId = accountId
            self.roomId = roomId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodePath(self.roomId, key: "RoomId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.roomId, name: "roomId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetRoomResponse: AWSDecodableShape {
        /// The room details.
        public let room: Room?

        @inlinable
        public init(room: Room? = nil) {
            self.room = room
        }

        private enum CodingKeys: String, CodingKey {
            case room = "Room"
        }
    }

    public struct GetUserRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The user ID.
        public let userId: String

        @inlinable
        public init(accountId: String, userId: String) {
            self.accountId = accountId
            self.userId = userId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodePath(self.userId, key: "UserId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.userId, name: "userId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetUserResponse: AWSDecodableShape {
        /// The user details.
        public let user: User?

        @inlinable
        public init(user: User? = nil) {
            self.user = user
        }

        private enum CodingKeys: String, CodingKey {
            case user = "User"
        }
    }

    public struct GetUserSettingsRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The user ID.
        public let userId: String

        @inlinable
        public init(accountId: String, userId: String) {
            self.accountId = accountId
            self.userId = userId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodePath(self.userId, key: "UserId")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetUserSettingsResponse: AWSDecodableShape {
        /// The user settings.
        public let userSettings: UserSettings?

        @inlinable
        public init(userSettings: UserSettings? = nil) {
            self.userSettings = userSettings
        }

        private enum CodingKeys: String, CodingKey {
            case userSettings = "UserSettings"
        }
    }

    public struct Invite: AWSDecodableShape {
        /// The email address to which the invite is sent.
        public let emailAddress: String?
        /// The status of the invite email.
        public let emailStatus: EmailStatus?
        /// The invite ID.
        public let inviteId: String?
        /// The status of the invite.
        public let status: InviteStatus?

        @inlinable
        public init(emailAddress: String? = nil, emailStatus: EmailStatus? = nil, inviteId: String? = nil, status: InviteStatus? = nil) {
            self.emailAddress = emailAddress
            self.emailStatus = emailStatus
            self.inviteId = inviteId
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case emailAddress = "EmailAddress"
            case emailStatus = "EmailStatus"
            case inviteId = "InviteId"
            case status = "Status"
        }
    }

    public struct InviteUsersRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The user email addresses to which to send the email invitation.
        public let userEmailList: [String]
        /// The user type.
        public let userType: UserType?

        @inlinable
        public init(accountId: String, userEmailList: [String], userType: UserType? = nil) {
            self.accountId = accountId
            self.userEmailList = userEmailList
            self.userType = userType
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            try container.encode(self.userEmailList, forKey: .userEmailList)
            try container.encodeIfPresent(self.userType, forKey: .userType)
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.userEmailList.forEach {
                try validate($0, name: "userEmailList[]", parent: name, pattern: "^.+@.+\\..+$")
            }
            try self.validate(self.userEmailList, name: "userEmailList", parent: name, max: 50)
        }

        private enum CodingKeys: String, CodingKey {
            case userEmailList = "UserEmailList"
            case userType = "UserType"
        }
    }

    public struct InviteUsersResponse: AWSDecodableShape {
        /// The email invitation details.
        public let invites: [Invite]?

        @inlinable
        public init(invites: [Invite]? = nil) {
            self.invites = invites
        }

        private enum CodingKeys: String, CodingKey {
            case invites = "Invites"
        }
    }

    public struct ListAccountsRequest: AWSEncodableShape {
        /// The maximum number of results to return in a single call. Defaults to 100.
        public let maxResults: Int?
        /// Amazon Chime account name prefix with which to filter results.
        public let name: String?
        /// The token to use to retrieve the next page of results.
        public let nextToken: String?
        /// User email address with which to filter results.
        public let userEmail: String?

        @inlinable
        public init(maxResults: Int? = nil, name: String? = nil, nextToken: String? = nil, userEmail: String? = nil) {
            self.maxResults = maxResults
            self.name = name
            self.nextToken = nextToken
            self.userEmail = userEmail
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.maxResults, key: "max-results")
            request.encodeQuery(self.name, key: "name")
            request.encodeQuery(self.nextToken, key: "next-token")
            request.encodeQuery(self.userEmail, key: "user-email")
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 200)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 100)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "\\S")
            try self.validate(self.userEmail, name: "userEmail", parent: name, pattern: "^.+@.+\\..+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListAccountsResponse: AWSDecodableShape {
        /// List of Amazon Chime accounts and account details.
        public let accounts: [Account]?
        /// The token to use to retrieve the next page of results.
        public let nextToken: String?

        @inlinable
        public init(accounts: [Account]? = nil, nextToken: String? = nil) {
            self.accounts = accounts
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case accounts = "Accounts"
            case nextToken = "NextToken"
        }
    }

    public struct ListBotsRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The maximum number of results to return in a single call. The default is 10.
        public let maxResults: Int?
        /// The token to use to retrieve the next page of results.
        public let nextToken: String?

        @inlinable
        public init(accountId: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.accountId = accountId
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodeQuery(self.maxResults, key: "max-results")
            request.encodeQuery(self.nextToken, key: "next-token")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 99)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListBotsResponse: AWSDecodableShape {
        /// List of bots and bot details.
        public let bots: [Bot]?
        /// The token to use to retrieve the next page of results.
        public let nextToken: String?

        @inlinable
        public init(bots: [Bot]? = nil, nextToken: String? = nil) {
            self.bots = bots
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case bots = "Bots"
            case nextToken = "NextToken"
        }
    }

    public struct ListPhoneNumberOrdersRequest: AWSEncodableShape {
        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        /// The token to use to retrieve the next page of results.
        public let nextToken: String?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.maxResults, key: "max-results")
            request.encodeQuery(self.nextToken, key: "next-token")
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 99)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListPhoneNumberOrdersResponse: AWSDecodableShape {
        /// The token to use to retrieve the next page of results.
        public let nextToken: String?
        /// The phone number order details.
        public let phoneNumberOrders: [PhoneNumberOrder]?

        @inlinable
        public init(nextToken: String? = nil, phoneNumberOrders: [PhoneNumberOrder]? = nil) {
            self.nextToken = nextToken
            self.phoneNumberOrders = phoneNumberOrders
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case phoneNumberOrders = "PhoneNumberOrders"
        }
    }

    public struct ListPhoneNumbersRequest: AWSEncodableShape {
        /// The filter to use to limit the number of results.
        public let filterName: PhoneNumberAssociationName?
        /// The value to use for the filter.
        public let filterValue: String?
        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        /// The token to use to retrieve the next page of results.
        public let nextToken: String?
        /// The phone number product type.
        public let productType: PhoneNumberProductType?
        /// The phone number status.
        public let status: PhoneNumberStatus?

        @inlinable
        public init(filterName: PhoneNumberAssociationName? = nil, filterValue: String? = nil, maxResults: Int? = nil, nextToken: String? = nil, productType: PhoneNumberProductType? = nil, status: PhoneNumberStatus? = nil) {
            self.filterName = filterName
            self.filterValue = filterValue
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.productType = productType
            self.status = status
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.filterName, key: "filter-name")
            request.encodeQuery(self.filterValue, key: "filter-value")
            request.encodeQuery(self.maxResults, key: "max-results")
            request.encodeQuery(self.nextToken, key: "next-token")
            request.encodeQuery(self.productType, key: "product-type")
            request.encodeQuery(self.status, key: "status")
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 99)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListPhoneNumbersResponse: AWSDecodableShape {
        /// The token to use to retrieve the next page of results.
        public let nextToken: String?
        /// The phone number details.
        public let phoneNumbers: [PhoneNumber]?

        @inlinable
        public init(nextToken: String? = nil, phoneNumbers: [PhoneNumber]? = nil) {
            self.nextToken = nextToken
            self.phoneNumbers = phoneNumbers
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case phoneNumbers = "PhoneNumbers"
        }
    }

    public struct ListRoomMembershipsRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        /// The token to use to retrieve the next page of results.
        public let nextToken: String?
        /// The room ID.
        public let roomId: String

        @inlinable
        public init(accountId: String, maxResults: Int? = nil, nextToken: String? = nil, roomId: String) {
            self.accountId = accountId
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.roomId = roomId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodeQuery(self.maxResults, key: "max-results")
            request.encodeQuery(self.nextToken, key: "next-token")
            request.encodePath(self.roomId, key: "RoomId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 99)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.roomId, name: "roomId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListRoomMembershipsResponse: AWSDecodableShape {
        /// The token to use to retrieve the next page of results.
        public let nextToken: String?
        /// The room membership details.
        public let roomMemberships: [RoomMembership]?

        @inlinable
        public init(nextToken: String? = nil, roomMemberships: [RoomMembership]? = nil) {
            self.nextToken = nextToken
            self.roomMemberships = roomMemberships
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case roomMemberships = "RoomMemberships"
        }
    }

    public struct ListRoomsRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        /// The member ID (user ID or bot ID).
        public let memberId: String?
        /// The token to use to retrieve the next page of results.
        public let nextToken: String?

        @inlinable
        public init(accountId: String, maxResults: Int? = nil, memberId: String? = nil, nextToken: String? = nil) {
            self.accountId = accountId
            self.maxResults = maxResults
            self.memberId = memberId
            self.nextToken = nextToken
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodeQuery(self.maxResults, key: "max-results")
            request.encodeQuery(self.memberId, key: "member-id")
            request.encodeQuery(self.nextToken, key: "next-token")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 99)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListRoomsResponse: AWSDecodableShape {
        /// The token to use to retrieve the next page of results.
        public let nextToken: String?
        /// The room details.
        public let rooms: [Room]?

        @inlinable
        public init(nextToken: String? = nil, rooms: [Room]? = nil) {
            self.nextToken = nextToken
            self.rooms = rooms
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case rooms = "Rooms"
        }
    }

    public struct ListSupportedPhoneNumberCountriesRequest: AWSEncodableShape {
        /// The phone number product type.
        public let productType: PhoneNumberProductType

        @inlinable
        public init(productType: PhoneNumberProductType) {
            self.productType = productType
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.productType, key: "product-type")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListSupportedPhoneNumberCountriesResponse: AWSDecodableShape {
        /// The supported phone number countries.
        public let phoneNumberCountries: [PhoneNumberCountry]?

        @inlinable
        public init(phoneNumberCountries: [PhoneNumberCountry]? = nil) {
            self.phoneNumberCountries = phoneNumberCountries
        }

        private enum CodingKeys: String, CodingKey {
            case phoneNumberCountries = "PhoneNumberCountries"
        }
    }

    public struct ListUsersRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The maximum number of results to return in a single call. Defaults to 100.
        public let maxResults: Int?
        /// The token to use to retrieve the next page of results.
        public let nextToken: String?
        /// Optional. The user email address used to filter results. Maximum 1.
        public let userEmail: String?
        /// The user type.
        public let userType: UserType?

        @inlinable
        public init(accountId: String, maxResults: Int? = nil, nextToken: String? = nil, userEmail: String? = nil, userType: UserType? = nil) {
            self.accountId = accountId
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.userEmail = userEmail
            self.userType = userType
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodeQuery(self.maxResults, key: "max-results")
            request.encodeQuery(self.nextToken, key: "next-token")
            request.encodeQuery(self.userEmail, key: "user-email")
            request.encodeQuery(self.userType, key: "user-type")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 200)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.userEmail, name: "userEmail", parent: name, pattern: "^.+@.+\\..+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListUsersResponse: AWSDecodableShape {
        /// The token to use to retrieve the next page of results.
        public let nextToken: String?
        /// List of users and user details.
        public let users: [User]?

        @inlinable
        public init(nextToken: String? = nil, users: [User]? = nil) {
            self.nextToken = nextToken
            self.users = users
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case users = "Users"
        }
    }

    public struct LogoutUserRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The user ID.
        public let userId: String

        @inlinable
        public init(accountId: String, userId: String) {
            self.accountId = accountId
            self.userId = userId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodePath(self.userId, key: "UserId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.userId, name: "userId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct LogoutUserResponse: AWSDecodableShape {
        public init() {}
    }

    public struct Member: AWSDecodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String?
        /// The member email address.
        public let email: String?
        /// The member name.
        public let fullName: String?
        /// The member ID (user ID or bot ID).
        public let memberId: String?
        /// The member type.
        public let memberType: MemberType?

        @inlinable
        public init(accountId: String? = nil, email: String? = nil, fullName: String? = nil, memberId: String? = nil, memberType: MemberType? = nil) {
            self.accountId = accountId
            self.email = email
            self.fullName = fullName
            self.memberId = memberId
            self.memberType = memberType
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case email = "Email"
            case fullName = "FullName"
            case memberId = "MemberId"
            case memberType = "MemberType"
        }
    }

    public struct MemberError: AWSDecodableShape {
        /// The error code.
        public let errorCode: ErrorCode?
        /// The error message.
        public let errorMessage: String?
        /// The member ID.
        public let memberId: String?

        @inlinable
        public init(errorCode: ErrorCode? = nil, errorMessage: String? = nil, memberId: String? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
            self.memberId = memberId
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
            case memberId = "MemberId"
        }
    }

    public struct MembershipItem: AWSEncodableShape {
        /// The member ID.
        public let memberId: String?
        /// The member role.
        public let role: RoomMembershipRole?

        @inlinable
        public init(memberId: String? = nil, role: RoomMembershipRole? = nil) {
            self.memberId = memberId
            self.role = role
        }

        public func validate(name: String) throws {
            try self.validate(self.memberId, name: "memberId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case memberId = "MemberId"
            case role = "Role"
        }
    }

    public struct NotFoundException: AWSErrorShape {
        public let code: ErrorCode?
        public let message: String?

        @inlinable
        public init(code: ErrorCode? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct OrderedPhoneNumber: AWSDecodableShape {
        /// The phone number, in E.164 format.
        public let e164PhoneNumber: String?
        /// The phone number status.
        public let status: OrderedPhoneNumberStatus?

        @inlinable
        public init(e164PhoneNumber: String? = nil, status: OrderedPhoneNumberStatus? = nil) {
            self.e164PhoneNumber = e164PhoneNumber
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case e164PhoneNumber = "E164PhoneNumber"
            case status = "Status"
        }
    }

    public struct PhoneNumber: AWSDecodableShape {
        /// The phone number associations.
        public let associations: [PhoneNumberAssociation]?
        /// The outbound calling name associated with the phone number.
        public let callingName: String?
        /// The outbound calling name status.
        public let callingNameStatus: CallingNameStatus?
        /// The phone number capabilities.
        public let capabilities: PhoneNumberCapabilities?
        /// The phone number country. Format: ISO 3166-1 alpha-2.
        public let country: String?
        /// The phone number creation timestamp, in ISO 8601 format.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var createdTimestamp: Date?
        /// The deleted phone number timestamp, in ISO 8601 format.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var deletionTimestamp: Date?
        /// The phone number, in E.164 format.
        public let e164PhoneNumber: String?
        /// The phone number ID.
        public let phoneNumberId: String?
        /// The phone number product type.
        public let productType: PhoneNumberProductType?
        /// The phone number status.
        public let status: PhoneNumberStatus?
        /// The phone number type.
        public let type: PhoneNumberType?
        /// The updated phone number timestamp, in ISO 8601 format.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var updatedTimestamp: Date?

        @inlinable
        public init(associations: [PhoneNumberAssociation]? = nil, callingName: String? = nil, callingNameStatus: CallingNameStatus? = nil, capabilities: PhoneNumberCapabilities? = nil, country: String? = nil, createdTimestamp: Date? = nil, deletionTimestamp: Date? = nil, e164PhoneNumber: String? = nil, phoneNumberId: String? = nil, productType: PhoneNumberProductType? = nil, status: PhoneNumberStatus? = nil, type: PhoneNumberType? = nil, updatedTimestamp: Date? = nil) {
            self.associations = associations
            self.callingName = callingName
            self.callingNameStatus = callingNameStatus
            self.capabilities = capabilities
            self.country = country
            self.createdTimestamp = createdTimestamp
            self.deletionTimestamp = deletionTimestamp
            self.e164PhoneNumber = e164PhoneNumber
            self.phoneNumberId = phoneNumberId
            self.productType = productType
            self.status = status
            self.type = type
            self.updatedTimestamp = updatedTimestamp
        }

        private enum CodingKeys: String, CodingKey {
            case associations = "Associations"
            case callingName = "CallingName"
            case callingNameStatus = "CallingNameStatus"
            case capabilities = "Capabilities"
            case country = "Country"
            case createdTimestamp = "CreatedTimestamp"
            case deletionTimestamp = "DeletionTimestamp"
            case e164PhoneNumber = "E164PhoneNumber"
            case phoneNumberId = "PhoneNumberId"
            case productType = "ProductType"
            case status = "Status"
            case type = "Type"
            case updatedTimestamp = "UpdatedTimestamp"
        }
    }

    public struct PhoneNumberAssociation: AWSDecodableShape {
        /// The timestamp of the phone number association, in ISO 8601 format.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var associatedTimestamp: Date?
        /// Defines the association with an Amazon Chime account ID, user ID, Amazon Chime Voice Connector ID, or Amazon Chime Voice Connector group ID.
        public let name: PhoneNumberAssociationName?
        /// Contains the ID for the entity specified in Name.
        public let value: String?

        @inlinable
        public init(associatedTimestamp: Date? = nil, name: PhoneNumberAssociationName? = nil, value: String? = nil) {
            self.associatedTimestamp = associatedTimestamp
            self.name = name
            self.value = value
        }

        private enum CodingKeys: String, CodingKey {
            case associatedTimestamp = "AssociatedTimestamp"
            case name = "Name"
            case value = "Value"
        }
    }

    public struct PhoneNumberCapabilities: AWSDecodableShape {
        /// Allows or denies inbound calling for the specified phone number.
        public let inboundCall: Bool?
        /// Allows or denies inbound MMS messaging for the specified phone number.
        public let inboundMMS: Bool?
        /// Allows or denies inbound SMS messaging for the specified phone number.
        public let inboundSMS: Bool?
        /// Allows or denies outbound calling for the specified phone number.
        public let outboundCall: Bool?
        /// Allows or denies outbound MMS messaging for the specified phone number.
        public let outboundMMS: Bool?
        /// Allows or denies outbound SMS messaging for the specified phone number.
        public let outboundSMS: Bool?

        @inlinable
        public init(inboundCall: Bool? = nil, inboundMMS: Bool? = nil, inboundSMS: Bool? = nil, outboundCall: Bool? = nil, outboundMMS: Bool? = nil, outboundSMS: Bool? = nil) {
            self.inboundCall = inboundCall
            self.inboundMMS = inboundMMS
            self.inboundSMS = inboundSMS
            self.outboundCall = outboundCall
            self.outboundMMS = outboundMMS
            self.outboundSMS = outboundSMS
        }

        private enum CodingKeys: String, CodingKey {
            case inboundCall = "InboundCall"
            case inboundMMS = "InboundMMS"
            case inboundSMS = "InboundSMS"
            case outboundCall = "OutboundCall"
            case outboundMMS = "OutboundMMS"
            case outboundSMS = "OutboundSMS"
        }
    }

    public struct PhoneNumberCountry: AWSDecodableShape {
        /// The phone number country code. Format: ISO 3166-1 alpha-2.
        public let countryCode: String?
        /// The supported phone number types.
        public let supportedPhoneNumberTypes: [PhoneNumberType]?

        @inlinable
        public init(countryCode: String? = nil, supportedPhoneNumberTypes: [PhoneNumberType]? = nil) {
            self.countryCode = countryCode
            self.supportedPhoneNumberTypes = supportedPhoneNumberTypes
        }

        private enum CodingKeys: String, CodingKey {
            case countryCode = "CountryCode"
            case supportedPhoneNumberTypes = "SupportedPhoneNumberTypes"
        }
    }

    public struct PhoneNumberError: AWSDecodableShape {
        /// The error code.
        public let errorCode: ErrorCode?
        /// The error message.
        public let errorMessage: String?
        /// The phone number ID for which the action failed.
        public let phoneNumberId: String?

        @inlinable
        public init(errorCode: ErrorCode? = nil, errorMessage: String? = nil, phoneNumberId: String? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
            self.phoneNumberId = phoneNumberId
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
            case phoneNumberId = "PhoneNumberId"
        }
    }

    public struct PhoneNumberOrder: AWSDecodableShape {
        /// The phone number order creation time stamp, in ISO 8601 format.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var createdTimestamp: Date?
        /// The ordered phone number details, such as the phone number in E.164 format and the phone number status.
        public let orderedPhoneNumbers: [OrderedPhoneNumber]?
        /// The phone number order ID.
        public let phoneNumberOrderId: String?
        /// The phone number order product type.
        public let productType: PhoneNumberProductType?
        /// The status of the phone number order.
        public let status: PhoneNumberOrderStatus?
        /// The updated phone number order time stamp, in ISO 8601 format.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var updatedTimestamp: Date?

        @inlinable
        public init(createdTimestamp: Date? = nil, orderedPhoneNumbers: [OrderedPhoneNumber]? = nil, phoneNumberOrderId: String? = nil, productType: PhoneNumberProductType? = nil, status: PhoneNumberOrderStatus? = nil, updatedTimestamp: Date? = nil) {
            self.createdTimestamp = createdTimestamp
            self.orderedPhoneNumbers = orderedPhoneNumbers
            self.phoneNumberOrderId = phoneNumberOrderId
            self.productType = productType
            self.status = status
            self.updatedTimestamp = updatedTimestamp
        }

        private enum CodingKeys: String, CodingKey {
            case createdTimestamp = "CreatedTimestamp"
            case orderedPhoneNumbers = "OrderedPhoneNumbers"
            case phoneNumberOrderId = "PhoneNumberOrderId"
            case productType = "ProductType"
            case status = "Status"
            case updatedTimestamp = "UpdatedTimestamp"
        }
    }

    public struct PutEventsConfigurationRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The bot ID.
        public let botId: String
        /// Lambda function ARN that allows the bot to receive outgoing events.
        public let lambdaFunctionArn: String?
        /// HTTPS endpoint that allows the bot to receive outgoing events.
        public let outboundEventsHTTPSEndpoint: String?

        @inlinable
        public init(accountId: String, botId: String, lambdaFunctionArn: String? = nil, outboundEventsHTTPSEndpoint: String? = nil) {
            self.accountId = accountId
            self.botId = botId
            self.lambdaFunctionArn = lambdaFunctionArn
            self.outboundEventsHTTPSEndpoint = outboundEventsHTTPSEndpoint
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodePath(self.botId, key: "BotId")
            try container.encodeIfPresent(self.lambdaFunctionArn, forKey: .lambdaFunctionArn)
            try container.encodeIfPresent(self.outboundEventsHTTPSEndpoint, forKey: .outboundEventsHTTPSEndpoint)
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.botId, name: "botId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case lambdaFunctionArn = "LambdaFunctionArn"
            case outboundEventsHTTPSEndpoint = "OutboundEventsHTTPSEndpoint"
        }
    }

    public struct PutEventsConfigurationResponse: AWSDecodableShape {
        /// The configuration that allows a bot to receive outgoing events. Can be an HTTPS endpoint or an  AWS Lambda function ARN.
        public let eventsConfiguration: EventsConfiguration?

        @inlinable
        public init(eventsConfiguration: EventsConfiguration? = nil) {
            self.eventsConfiguration = eventsConfiguration
        }

        private enum CodingKeys: String, CodingKey {
            case eventsConfiguration = "EventsConfiguration"
        }
    }

    public struct PutRetentionSettingsRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The retention settings.
        public let retentionSettings: RetentionSettings

        @inlinable
        public init(accountId: String, retentionSettings: RetentionSettings) {
            self.accountId = accountId
            self.retentionSettings = retentionSettings
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            try container.encode(self.retentionSettings, forKey: .retentionSettings)
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.retentionSettings.validate(name: "\(name).retentionSettings")
        }

        private enum CodingKeys: String, CodingKey {
            case retentionSettings = "RetentionSettings"
        }
    }

    public struct PutRetentionSettingsResponse: AWSDecodableShape {
        /// The timestamp representing the time at which the specified items are permanently deleted, in ISO 8601 format.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var initiateDeletionTimestamp: Date?
        /// The retention settings.
        public let retentionSettings: RetentionSettings?

        @inlinable
        public init(initiateDeletionTimestamp: Date? = nil, retentionSettings: RetentionSettings? = nil) {
            self.initiateDeletionTimestamp = initiateDeletionTimestamp
            self.retentionSettings = retentionSettings
        }

        private enum CodingKeys: String, CodingKey {
            case initiateDeletionTimestamp = "InitiateDeletionTimestamp"
            case retentionSettings = "RetentionSettings"
        }
    }

    public struct RedactConversationMessageRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The conversation ID.
        public let conversationId: String
        /// The message ID.
        public let messageId: String

        @inlinable
        public init(accountId: String, conversationId: String, messageId: String) {
            self.accountId = accountId
            self.conversationId = conversationId
            self.messageId = messageId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodePath(self.conversationId, key: "ConversationId")
            request.encodePath(self.messageId, key: "MessageId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.conversationId, name: "conversationId", parent: name, pattern: "\\S")
            try self.validate(self.messageId, name: "messageId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct RedactConversationMessageResponse: AWSDecodableShape {
        public init() {}
    }

    public struct RedactRoomMessageRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The message ID.
        public let messageId: String
        /// The room ID.
        public let roomId: String

        @inlinable
        public init(accountId: String, messageId: String, roomId: String) {
            self.accountId = accountId
            self.messageId = messageId
            self.roomId = roomId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodePath(self.messageId, key: "MessageId")
            request.encodePath(self.roomId, key: "RoomId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.messageId, name: "messageId", parent: name, pattern: "\\S")
            try self.validate(self.roomId, name: "roomId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct RedactRoomMessageResponse: AWSDecodableShape {
        public init() {}
    }

    public struct RegenerateSecurityTokenRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The bot ID.
        public let botId: String

        @inlinable
        public init(accountId: String, botId: String) {
            self.accountId = accountId
            self.botId = botId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodePath(self.botId, key: "BotId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.botId, name: "botId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct RegenerateSecurityTokenResponse: AWSDecodableShape {
        /// A resource that allows Enterprise account administrators to configure an interface that receives events from Amazon Chime.
        public let bot: Bot?

        @inlinable
        public init(bot: Bot? = nil) {
            self.bot = bot
        }

        private enum CodingKeys: String, CodingKey {
            case bot = "Bot"
        }
    }

    public struct ResetPersonalPINRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The user ID.
        public let userId: String

        @inlinable
        public init(accountId: String, userId: String) {
            self.accountId = accountId
            self.userId = userId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodePath(self.userId, key: "UserId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.userId, name: "userId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ResetPersonalPINResponse: AWSDecodableShape {
        /// The user details and new personal meeting PIN.
        public let user: User?

        @inlinable
        public init(user: User? = nil) {
            self.user = user
        }

        private enum CodingKeys: String, CodingKey {
            case user = "User"
        }
    }

    public struct ResourceLimitExceededException: AWSErrorShape {
        public let code: ErrorCode?
        public let message: String?

        @inlinable
        public init(code: ErrorCode? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct RestorePhoneNumberRequest: AWSEncodableShape {
        /// The phone number.
        public let phoneNumberId: String

        @inlinable
        public init(phoneNumberId: String) {
            self.phoneNumberId = phoneNumberId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.phoneNumberId, key: "PhoneNumberId")
        }

        public func validate(name: String) throws {
            try self.validate(self.phoneNumberId, name: "phoneNumberId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct RestorePhoneNumberResponse: AWSDecodableShape {
        /// The phone number details.
        public let phoneNumber: PhoneNumber?

        @inlinable
        public init(phoneNumber: PhoneNumber? = nil) {
            self.phoneNumber = phoneNumber
        }

        private enum CodingKeys: String, CodingKey {
            case phoneNumber = "PhoneNumber"
        }
    }

    public struct RetentionSettings: AWSEncodableShape & AWSDecodableShape {
        /// The chat conversation retention settings.
        public let conversationRetentionSettings: ConversationRetentionSettings?
        /// The chat room retention settings.
        public let roomRetentionSettings: RoomRetentionSettings?

        @inlinable
        public init(conversationRetentionSettings: ConversationRetentionSettings? = nil, roomRetentionSettings: RoomRetentionSettings? = nil) {
            self.conversationRetentionSettings = conversationRetentionSettings
            self.roomRetentionSettings = roomRetentionSettings
        }

        public func validate(name: String) throws {
            try self.conversationRetentionSettings?.validate(name: "\(name).conversationRetentionSettings")
            try self.roomRetentionSettings?.validate(name: "\(name).roomRetentionSettings")
        }

        private enum CodingKeys: String, CodingKey {
            case conversationRetentionSettings = "ConversationRetentionSettings"
            case roomRetentionSettings = "RoomRetentionSettings"
        }
    }

    public struct Room: AWSDecodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String?
        /// The identifier of the room creator.
        public let createdBy: String?
        /// The room creation timestamp, in ISO 8601 format.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var createdTimestamp: Date?
        /// The room name.
        public let name: String?
        /// The room ID.
        public let roomId: String?
        /// The room update timestamp, in ISO 8601 format.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var updatedTimestamp: Date?

        @inlinable
        public init(accountId: String? = nil, createdBy: String? = nil, createdTimestamp: Date? = nil, name: String? = nil, roomId: String? = nil, updatedTimestamp: Date? = nil) {
            self.accountId = accountId
            self.createdBy = createdBy
            self.createdTimestamp = createdTimestamp
            self.name = name
            self.roomId = roomId
            self.updatedTimestamp = updatedTimestamp
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case createdBy = "CreatedBy"
            case createdTimestamp = "CreatedTimestamp"
            case name = "Name"
            case roomId = "RoomId"
            case updatedTimestamp = "UpdatedTimestamp"
        }
    }

    public struct RoomMembership: AWSDecodableShape {
        /// The identifier of the user that invited the room member.
        public let invitedBy: String?
        /// The member details, such as email address, name, member ID, and member type.
        public let member: Member?
        /// The membership role.
        public let role: RoomMembershipRole?
        /// The room ID.
        public let roomId: String?
        /// The room membership update timestamp, in ISO 8601 format.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var updatedTimestamp: Date?

        @inlinable
        public init(invitedBy: String? = nil, member: Member? = nil, role: RoomMembershipRole? = nil, roomId: String? = nil, updatedTimestamp: Date? = nil) {
            self.invitedBy = invitedBy
            self.member = member
            self.role = role
            self.roomId = roomId
            self.updatedTimestamp = updatedTimestamp
        }

        private enum CodingKeys: String, CodingKey {
            case invitedBy = "InvitedBy"
            case member = "Member"
            case role = "Role"
            case roomId = "RoomId"
            case updatedTimestamp = "UpdatedTimestamp"
        }
    }

    public struct RoomRetentionSettings: AWSEncodableShape & AWSDecodableShape {
        /// The number of days for which to retain chat-room messages.
        public let retentionDays: Int?

        @inlinable
        public init(retentionDays: Int? = nil) {
            self.retentionDays = retentionDays
        }

        public func validate(name: String) throws {
            try self.validate(self.retentionDays, name: "retentionDays", parent: name, max: 5475)
            try self.validate(self.retentionDays, name: "retentionDays", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case retentionDays = "RetentionDays"
        }
    }

    public struct SearchAvailablePhoneNumbersRequest: AWSEncodableShape {
        /// The area code used to filter results. Only applies to the US.
        public let areaCode: String?
        /// The city used to filter results. Only applies to the US.
        public let city: String?
        /// The country used to filter results. Defaults to the US Format: ISO 3166-1 alpha-2.
        public let country: String?
        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        /// The token used to retrieve the next page of results.
        public let nextToken: String?
        /// The phone number type used to filter results. Required for non-US numbers.
        public let phoneNumberType: PhoneNumberType?
        /// The state used to filter results. Required only if you provide City. Only applies to the US.
        public let state: String?
        /// The toll-free prefix that you use to filter results. Only applies to the US.
        public let tollFreePrefix: String?

        @inlinable
        public init(areaCode: String? = nil, city: String? = nil, country: String? = nil, maxResults: Int? = nil, nextToken: String? = nil, phoneNumberType: PhoneNumberType? = nil, state: String? = nil, tollFreePrefix: String? = nil) {
            self.areaCode = areaCode
            self.city = city
            self.country = country
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.phoneNumberType = phoneNumberType
            self.state = state
            self.tollFreePrefix = tollFreePrefix
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.areaCode, key: "area-code")
            request.encodeQuery(self.city, key: "city")
            request.encodeQuery(self.country, key: "country")
            request.encodeQuery(self.maxResults, key: "max-results")
            request.encodeQuery(self.nextToken, key: "next-token")
            request.encodeQuery(self.phoneNumberType, key: "phone-number-type")
            request.encodeQuery(self.state, key: "state")
            request.encodeQuery(self.tollFreePrefix, key: "toll-free-prefix")
        }

        public func validate(name: String) throws {
            try self.validate(self.country, name: "country", parent: name, pattern: "^[A-Z]{2}$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 500)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.tollFreePrefix, name: "tollFreePrefix", parent: name, max: 3)
            try self.validate(self.tollFreePrefix, name: "tollFreePrefix", parent: name, min: 3)
            try self.validate(self.tollFreePrefix, name: "tollFreePrefix", parent: name, pattern: "^8(00|33|44|55|66|77|88)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct SearchAvailablePhoneNumbersResponse: AWSDecodableShape {
        /// List of phone numbers, in E.164 format.
        public let e164PhoneNumbers: [String]?
        /// The token used to retrieve the next page of search results.
        public let nextToken: String?

        @inlinable
        public init(e164PhoneNumbers: [String]? = nil, nextToken: String? = nil) {
            self.e164PhoneNumbers = e164PhoneNumbers
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case e164PhoneNumbers = "E164PhoneNumbers"
            case nextToken = "NextToken"
        }
    }

    public struct ServiceFailureException: AWSErrorShape {
        public let code: ErrorCode?
        public let message: String?

        @inlinable
        public init(code: ErrorCode? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct ServiceUnavailableException: AWSErrorShape {
        public let code: ErrorCode?
        public let message: String?

        @inlinable
        public init(code: ErrorCode? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct SigninDelegateGroup: AWSEncodableShape & AWSDecodableShape {
        /// The group name.
        public let groupName: String?

        @inlinable
        public init(groupName: String? = nil) {
            self.groupName = groupName
        }

        public func validate(name: String) throws {
            try self.validate(self.groupName, name: "groupName", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case groupName = "GroupName"
        }
    }

    public struct TelephonySettings: AWSEncodableShape & AWSDecodableShape {
        /// Allows or denies inbound calling.
        public let inboundCalling: Bool
        /// Allows or denies outbound calling.
        public let outboundCalling: Bool
        /// Allows or denies SMS messaging.
        public let sms: Bool

        @inlinable
        public init(inboundCalling: Bool, outboundCalling: Bool, sms: Bool) {
            self.inboundCalling = inboundCalling
            self.outboundCalling = outboundCalling
            self.sms = sms
        }

        private enum CodingKeys: String, CodingKey {
            case inboundCalling = "InboundCalling"
            case outboundCalling = "OutboundCalling"
            case sms = "SMS"
        }
    }

    public struct ThrottledClientException: AWSErrorShape {
        public let code: ErrorCode?
        public let message: String?

        @inlinable
        public init(code: ErrorCode? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct UnauthorizedClientException: AWSErrorShape {
        public let code: ErrorCode?
        public let message: String?

        @inlinable
        public init(code: ErrorCode? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct UnprocessableEntityException: AWSErrorShape {
        public let code: ErrorCode?
        public let message: String?

        @inlinable
        public init(code: ErrorCode? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct UpdateAccountRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The default license applied when you add users to an Amazon Chime account.
        public let defaultLicense: License?
        /// The new name for the specified Amazon Chime account.
        public let name: String?

        @inlinable
        public init(accountId: String, defaultLicense: License? = nil, name: String? = nil) {
            self.accountId = accountId
            self.defaultLicense = defaultLicense
            self.name = name
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            try container.encodeIfPresent(self.defaultLicense, forKey: .defaultLicense)
            try container.encodeIfPresent(self.name, forKey: .name)
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.name, name: "name", parent: name, max: 100)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case defaultLicense = "DefaultLicense"
            case name = "Name"
        }
    }

    public struct UpdateAccountResponse: AWSDecodableShape {
        /// The updated Amazon Chime account details.
        public let account: Account?

        @inlinable
        public init(account: Account? = nil) {
            self.account = account
        }

        private enum CodingKeys: String, CodingKey {
            case account = "Account"
        }
    }

    public struct UpdateAccountSettingsRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The Amazon Chime account settings to update.
        public let accountSettings: AccountSettings

        @inlinable
        public init(accountId: String, accountSettings: AccountSettings) {
            self.accountId = accountId
            self.accountSettings = accountSettings
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            try container.encode(self.accountSettings, forKey: .accountSettings)
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case accountSettings = "AccountSettings"
        }
    }

    public struct UpdateAccountSettingsResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateBotRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The bot ID.
        public let botId: String
        /// When true, stops the specified bot from running in your account.
        public let disabled: Bool?

        @inlinable
        public init(accountId: String, botId: String, disabled: Bool? = nil) {
            self.accountId = accountId
            self.botId = botId
            self.disabled = disabled
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodePath(self.botId, key: "BotId")
            try container.encodeIfPresent(self.disabled, forKey: .disabled)
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.botId, name: "botId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case disabled = "Disabled"
        }
    }

    public struct UpdateBotResponse: AWSDecodableShape {
        /// The updated bot details.
        public let bot: Bot?

        @inlinable
        public init(bot: Bot? = nil) {
            self.bot = bot
        }

        private enum CodingKeys: String, CodingKey {
            case bot = "Bot"
        }
    }

    public struct UpdateGlobalSettingsRequest: AWSEncodableShape {
        /// The Amazon Chime Business Calling settings.
        public let businessCalling: BusinessCallingSettings?
        /// The Amazon Chime Voice Connector settings.
        public let voiceConnector: VoiceConnectorSettings?

        @inlinable
        public init(businessCalling: BusinessCallingSettings? = nil, voiceConnector: VoiceConnectorSettings? = nil) {
            self.businessCalling = businessCalling
            self.voiceConnector = voiceConnector
        }

        private enum CodingKeys: String, CodingKey {
            case businessCalling = "BusinessCalling"
            case voiceConnector = "VoiceConnector"
        }
    }

    public struct UpdatePhoneNumberRequest: AWSEncodableShape {
        /// The outbound calling name associated with the phone number.
        public let callingName: String?
        /// The phone number ID.
        public let phoneNumberId: String
        /// The product type.
        public let productType: PhoneNumberProductType?

        @inlinable
        public init(callingName: String? = nil, phoneNumberId: String, productType: PhoneNumberProductType? = nil) {
            self.callingName = callingName
            self.phoneNumberId = phoneNumberId
            self.productType = productType
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            try container.encodeIfPresent(self.callingName, forKey: .callingName)
            request.encodePath(self.phoneNumberId, key: "PhoneNumberId")
            try container.encodeIfPresent(self.productType, forKey: .productType)
        }

        public func validate(name: String) throws {
            try self.validate(self.callingName, name: "callingName", parent: name, pattern: "^$|^[a-zA-Z0-9 ]{2,15}$")
        }

        private enum CodingKeys: String, CodingKey {
            case callingName = "CallingName"
            case productType = "ProductType"
        }
    }

    public struct UpdatePhoneNumberRequestItem: AWSEncodableShape {
        /// The outbound calling name to update.
        public let callingName: String?
        /// The phone number ID to update.
        public let phoneNumberId: String
        /// The product type to update.
        public let productType: PhoneNumberProductType?

        @inlinable
        public init(callingName: String? = nil, phoneNumberId: String, productType: PhoneNumberProductType? = nil) {
            self.callingName = callingName
            self.phoneNumberId = phoneNumberId
            self.productType = productType
        }

        public func validate(name: String) throws {
            try self.validate(self.callingName, name: "callingName", parent: name, pattern: "^$|^[a-zA-Z0-9 ]{2,15}$")
            try self.validate(self.phoneNumberId, name: "phoneNumberId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case callingName = "CallingName"
            case phoneNumberId = "PhoneNumberId"
            case productType = "ProductType"
        }
    }

    public struct UpdatePhoneNumberResponse: AWSDecodableShape {
        /// The updated phone number details.
        public let phoneNumber: PhoneNumber?

        @inlinable
        public init(phoneNumber: PhoneNumber? = nil) {
            self.phoneNumber = phoneNumber
        }

        private enum CodingKeys: String, CodingKey {
            case phoneNumber = "PhoneNumber"
        }
    }

    public struct UpdatePhoneNumberSettingsRequest: AWSEncodableShape {
        /// The default outbound calling name for the account.
        public let callingName: String

        @inlinable
        public init(callingName: String) {
            self.callingName = callingName
        }

        public func validate(name: String) throws {
            try self.validate(self.callingName, name: "callingName", parent: name, pattern: "^$|^[a-zA-Z0-9 ]{2,15}$")
        }

        private enum CodingKeys: String, CodingKey {
            case callingName = "CallingName"
        }
    }

    public struct UpdateRoomMembershipRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The member ID.
        public let memberId: String
        /// The role of the member.
        public let role: RoomMembershipRole?
        /// The room ID.
        public let roomId: String

        @inlinable
        public init(accountId: String, memberId: String, role: RoomMembershipRole? = nil, roomId: String) {
            self.accountId = accountId
            self.memberId = memberId
            self.role = role
            self.roomId = roomId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodePath(self.memberId, key: "MemberId")
            try container.encodeIfPresent(self.role, forKey: .role)
            request.encodePath(self.roomId, key: "RoomId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.memberId, name: "memberId", parent: name, pattern: "\\S")
            try self.validate(self.roomId, name: "roomId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case role = "Role"
        }
    }

    public struct UpdateRoomMembershipResponse: AWSDecodableShape {
        /// The room membership details.
        public let roomMembership: RoomMembership?

        @inlinable
        public init(roomMembership: RoomMembership? = nil) {
            self.roomMembership = roomMembership
        }

        private enum CodingKeys: String, CodingKey {
            case roomMembership = "RoomMembership"
        }
    }

    public struct UpdateRoomRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The room name.
        public let name: String?
        /// The room ID.
        public let roomId: String

        @inlinable
        public init(accountId: String, name: String? = nil, roomId: String) {
            self.accountId = accountId
            self.name = name
            self.roomId = roomId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            try container.encodeIfPresent(self.name, forKey: .name)
            request.encodePath(self.roomId, key: "RoomId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.roomId, name: "roomId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct UpdateRoomResponse: AWSDecodableShape {
        /// The room details.
        public let room: Room?

        @inlinable
        public init(room: Room? = nil) {
            self.room = room
        }

        private enum CodingKeys: String, CodingKey {
            case room = "Room"
        }
    }

    public struct UpdateUserRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The Alexa for Business metadata.
        public let alexaForBusinessMetadata: AlexaForBusinessMetadata?
        /// The user license type to update. This must be a supported license type for the Amazon Chime account that the user belongs to.
        public let licenseType: License?
        /// The user ID.
        public let userId: String
        /// The user type.
        public let userType: UserType?

        @inlinable
        public init(accountId: String, alexaForBusinessMetadata: AlexaForBusinessMetadata? = nil, licenseType: License? = nil, userId: String, userType: UserType? = nil) {
            self.accountId = accountId
            self.alexaForBusinessMetadata = alexaForBusinessMetadata
            self.licenseType = licenseType
            self.userId = userId
            self.userType = userType
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            try container.encodeIfPresent(self.alexaForBusinessMetadata, forKey: .alexaForBusinessMetadata)
            try container.encodeIfPresent(self.licenseType, forKey: .licenseType)
            request.encodePath(self.userId, key: "UserId")
            try container.encodeIfPresent(self.userType, forKey: .userType)
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "\\S")
            try self.validate(self.userId, name: "userId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case alexaForBusinessMetadata = "AlexaForBusinessMetadata"
            case licenseType = "LicenseType"
            case userType = "UserType"
        }
    }

    public struct UpdateUserRequestItem: AWSEncodableShape {
        /// The Alexa for Business metadata.
        public let alexaForBusinessMetadata: AlexaForBusinessMetadata?
        /// The user license type.
        public let licenseType: License?
        /// The user ID.
        public let userId: String
        /// The user type.
        public let userType: UserType?

        @inlinable
        public init(alexaForBusinessMetadata: AlexaForBusinessMetadata? = nil, licenseType: License? = nil, userId: String, userType: UserType? = nil) {
            self.alexaForBusinessMetadata = alexaForBusinessMetadata
            self.licenseType = licenseType
            self.userId = userId
            self.userType = userType
        }

        public func validate(name: String) throws {
            try self.validate(self.userId, name: "userId", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case alexaForBusinessMetadata = "AlexaForBusinessMetadata"
            case licenseType = "LicenseType"
            case userId = "UserId"
            case userType = "UserType"
        }
    }

    public struct UpdateUserResponse: AWSDecodableShape {
        /// The updated user details.
        public let user: User?

        @inlinable
        public init(user: User? = nil) {
            self.user = user
        }

        private enum CodingKeys: String, CodingKey {
            case user = "User"
        }
    }

    public struct UpdateUserSettingsRequest: AWSEncodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String
        /// The user ID.
        public let userId: String
        /// The user settings to update.
        public let userSettings: UserSettings

        @inlinable
        public init(accountId: String, userId: String, userSettings: UserSettings) {
            self.accountId = accountId
            self.userId = userId
            self.userSettings = userSettings
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.accountId, key: "AccountId")
            request.encodePath(self.userId, key: "UserId")
            try container.encode(self.userSettings, forKey: .userSettings)
        }

        private enum CodingKeys: String, CodingKey {
            case userSettings = "UserSettings"
        }
    }

    public struct User: AWSDecodableShape {
        /// The Amazon Chime account ID.
        public let accountId: String?
        /// The Alexa for Business metadata.
        public let alexaForBusinessMetadata: AlexaForBusinessMetadata?
        /// The display name of the user.
        public let displayName: String?
        /// Date and time when the user is invited to the Amazon Chime account, in ISO 8601 format.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var invitedOn: Date?
        /// The license type for the user.
        public let licenseType: License?
        /// The user's personal meeting PIN.
        public let personalPIN: String?
        /// The primary email address of the user.
        public let primaryEmail: String?
        /// The primary phone number associated with the user.
        public let primaryProvisionedNumber: String?
        /// Date and time when the user is registered, in ISO 8601 format.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var registeredOn: Date?
        /// The user ID.
        public let userId: String
        /// The user invite status.
        public let userInvitationStatus: InviteStatus?
        /// The user registration status.
        public let userRegistrationStatus: RegistrationStatus?
        /// The user type.
        public let userType: UserType?

        @inlinable
        public init(accountId: String? = nil, alexaForBusinessMetadata: AlexaForBusinessMetadata? = nil, displayName: String? = nil, invitedOn: Date? = nil, licenseType: License? = nil, personalPIN: String? = nil, primaryEmail: String? = nil, primaryProvisionedNumber: String? = nil, registeredOn: Date? = nil, userId: String, userInvitationStatus: InviteStatus? = nil, userRegistrationStatus: RegistrationStatus? = nil, userType: UserType? = nil) {
            self.accountId = accountId
            self.alexaForBusinessMetadata = alexaForBusinessMetadata
            self.displayName = displayName
            self.invitedOn = invitedOn
            self.licenseType = licenseType
            self.personalPIN = personalPIN
            self.primaryEmail = primaryEmail
            self.primaryProvisionedNumber = primaryProvisionedNumber
            self.registeredOn = registeredOn
            self.userId = userId
            self.userInvitationStatus = userInvitationStatus
            self.userRegistrationStatus = userRegistrationStatus
            self.userType = userType
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case alexaForBusinessMetadata = "AlexaForBusinessMetadata"
            case displayName = "DisplayName"
            case invitedOn = "InvitedOn"
            case licenseType = "LicenseType"
            case personalPIN = "PersonalPIN"
            case primaryEmail = "PrimaryEmail"
            case primaryProvisionedNumber = "PrimaryProvisionedNumber"
            case registeredOn = "RegisteredOn"
            case userId = "UserId"
            case userInvitationStatus = "UserInvitationStatus"
            case userRegistrationStatus = "UserRegistrationStatus"
            case userType = "UserType"
        }
    }

    public struct UserError: AWSDecodableShape {
        /// The error code.
        public let errorCode: ErrorCode?
        /// The error message.
        public let errorMessage: String?
        /// The user ID for which the action failed.
        public let userId: String?

        @inlinable
        public init(errorCode: ErrorCode? = nil, errorMessage: String? = nil, userId: String? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
            self.userId = userId
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
            case userId = "UserId"
        }
    }

    public struct UserSettings: AWSEncodableShape & AWSDecodableShape {
        /// The telephony settings associated with the user.
        public let telephony: TelephonySettings

        @inlinable
        public init(telephony: TelephonySettings) {
            self.telephony = telephony
        }

        private enum CodingKeys: String, CodingKey {
            case telephony = "Telephony"
        }
    }

    public struct VoiceConnectorSettings: AWSEncodableShape & AWSDecodableShape {
        /// The Amazon S3 bucket designated for call detail record storage.
        public let cdrBucket: String?

        @inlinable
        public init(cdrBucket: String? = nil) {
            self.cdrBucket = cdrBucket
        }

        private enum CodingKeys: String, CodingKey {
            case cdrBucket = "CdrBucket"
        }
    }
}

// MARK: - Errors

/// Error enum for Chime
public struct ChimeErrorType: AWSErrorType {
    enum Code: String {
        case accessDeniedException = "AccessDeniedException"
        case badRequestException = "BadRequestException"
        case conflictException = "ConflictException"
        case forbiddenException = "ForbiddenException"
        case notFoundException = "NotFoundException"
        case resourceLimitExceededException = "ResourceLimitExceededException"
        case serviceFailureException = "ServiceFailureException"
        case serviceUnavailableException = "ServiceUnavailableException"
        case throttledClientException = "ThrottledClientException"
        case unauthorizedClientException = "UnauthorizedClientException"
        case unprocessableEntityException = "UnprocessableEntityException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize Chime
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// You don't have permissions to perform the requested operation.
    public static var accessDeniedException: Self { .init(.accessDeniedException) }
    /// The input parameters don't match the service's restrictions.
    public static var badRequestException: Self { .init(.badRequestException) }
    /// The request could not be processed because of conflict in the current state of the resource.
    public static var conflictException: Self { .init(.conflictException) }
    /// The client is permanently forbidden from making the request.
    public static var forbiddenException: Self { .init(.forbiddenException) }
    /// One or more of the resources in the request does not exist in the system.
    public static var notFoundException: Self { .init(.notFoundException) }
    /// The request exceeds the resource limit.
    public static var resourceLimitExceededException: Self { .init(.resourceLimitExceededException) }
    /// The service encountered an unexpected error.
    public static var serviceFailureException: Self { .init(.serviceFailureException) }
    /// The service is currently unavailable.
    public static var serviceUnavailableException: Self { .init(.serviceUnavailableException) }
    /// The client exceeded its request rate limit.
    public static var throttledClientException: Self { .init(.throttledClientException) }
    /// The client is not currently authorized to make the request.
    public static var unauthorizedClientException: Self { .init(.unauthorizedClientException) }
    /// The request was well-formed but was unable to be followed due to semantic errors.
    public static var unprocessableEntityException: Self { .init(.unprocessableEntityException) }
}

extension ChimeErrorType: AWSServiceErrorType {
    public static let errorCodeMap: [String: AWSErrorShape.Type] = [
        "AccessDeniedException": Chime.AccessDeniedException.self,
        "BadRequestException": Chime.BadRequestException.self,
        "ConflictException": Chime.ConflictException.self,
        "ForbiddenException": Chime.ForbiddenException.self,
        "NotFoundException": Chime.NotFoundException.self,
        "ResourceLimitExceededException": Chime.ResourceLimitExceededException.self,
        "ServiceFailureException": Chime.ServiceFailureException.self,
        "ServiceUnavailableException": Chime.ServiceUnavailableException.self,
        "ThrottledClientException": Chime.ThrottledClientException.self,
        "UnauthorizedClientException": Chime.UnauthorizedClientException.self,
        "UnprocessableEntityException": Chime.UnprocessableEntityException.self
    ]
}

extension ChimeErrorType: Equatable {
    public static func == (lhs: ChimeErrorType, rhs: ChimeErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension ChimeErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
